package com.cx.controller.lcd;

import com.cx.pojo.Game;
import com.cx.service.lcd.GamedetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


import javax.servlet.http.HttpSession;
import java.io.IOException;


@Controller
@RequestMapping("gamedetails")
public class GamedetailsController {

    @Autowired
    private GamedetailsService gamedetailsService;

    @RequestMapping("gamedetailslist")
    public String gamedetailslist(Integer gameId, HttpSession session)throws IOException {
        Game game = gamedetailsService.selectByGameId(gameId);
        session.setAttribute("game",game);
        return "forward:/gamedetails.jsp";
    }
}
